#include "xmppcore/xmppparserfactory.h"

#include <QtCore/QObject>

namespace yoohoo_xmppcore {

class XmppParsingFactory;

}

namespace yoohoo_xdata {

using namespace yoohoo_xmppcore;

class XDataForm;

class Register : public XmppObject {
public:
	Register();
	~Register();
	XDataForm* dataForm();
	void setDataForm(XDataForm* dataForm);

private:
	XDataForm* _dataForm;
};

class RegisterParser : public XmppParser {
public:
	RegisterParser();
	XmppObject* obj();
	bool processAttributes(QString path, QList<ParsingAttribute> attributes);
	bool processText(QString path, QString text);
	bool processEmbeddedObject(ProtocolKey protocolKey, XmppObject* object);

private:
	Register* _register;
};

class RegisterParserFactory : public XmppParserFactory {
public:
	ProtocolKey protocolKey();
	XmppParser* createParser();
};

class XDataTest : public QObject {
	Q_OBJECT
private slots:
	void init();
	void testParsing();
	void testTranslating();
	void cleanup();

private:
	XmppParsingFactory* _parsingFactory;
};

}
